package zy1208.zy7;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.lang.reflect.Field;
import java.util.List;

public class demo {
    public static void main(String[] args) throws Exception {
        List<String> lines = FileUtils.readLines(new File("src/zy1208/zy7/CatData.txt"));
        for (String line : lines) {
            String re = line.replace(" ", "=");
            String[] split = re.split("=");
            Class<?> aClass = Class.forName(split[0]);
            Object o = aClass.newInstance();
            Field f1 = aClass.getDeclaredField(split[1]);
            f1.setAccessible(true);
            f1.set(o,split[2].substring(1,3));
            System.out.print(f1.get(o)+" ");
            Field f2 = aClass.getDeclaredField(split[3]);
            f2.setAccessible(true);
            f2.set(o,Integer.parseInt(split[4]));
            System.out.print(f2.get(o));

        }
    }
}
